<template>
  <section class="user-section">
    <div class="user-avtor">
      <img src="@/assets/images/diy/user-page/user-default.png" alt="" />
    </div>
    <div class="user-name">
      <span :style="{ color: fontColor }">会员昵称</span>
      <img src="@/assets/images/diy/user-page/member-level.png" alt="" />
    </div>
    <div class="user-set">
      <i class="iconfont icon-set" :style="{ color: fontColor }"></i>
    </div>
    <div class="member-code">
      <i class="iconfont icon-QRcode" :style="{ color: fontColor }"></i>
      <div class="code-text">
        <span :style="{ color: fontColor }">会员码</span>
      </div>
    </div>
    <div class="menber-badges">
      <div class="menber-badges-item">
        <div :style="{ color: fontColor }">普通会员</div>
        <i class="iconfont icon-weibiaoti-13" :style="{ color: fontColor }"></i>
      </div>
      <div class="menber-badges-item">
        <div :style="{ color: fontColor }">实名认证</div>
        <i class="iconfont icon-weibiaoti-13" :style="{ color: fontColor }"></i>
      </div>
    </div>
    <div class="member-tabs">
      <div class="tab-item">
        <span class="tab-badge-num" :style="{ color: fontColor }">7</span>
        <span class="tab-text" :style="{ color: fontColor }">商品收藏</span>
      </div>
      <div class="tab-item">
        <span class="tab-badge-num" :style="{ color: fontColor }">7</span>
        <span class="tab-text" :style="{ color: fontColor }">店铺收藏</span>
      </div>
      <div class="tab-item">
        <span class="tab-badge-num" :style="{ color: fontColor }">7</span>
        <span class="tab-text" :style="{ color: fontColor }">优惠券</span>
      </div>
      <div class="tab-item">
        <span class="tab-badge-num" :style="{ color: fontColor }">7</span>
        <span class="tab-text" :style="{ color: fontColor }">我的足迹</span>
      </div>
    </div>
    <memberCardTem
      :propsData="propsData"
      @handleItemToControl="handleItemToControl"
    ></memberCardTem>
    <!--  -->
    <memberTabGroup
      :propsData="propsData"
      @handleItemToControl="handleItemToControl"
    ></memberTabGroup>
  </section>
</template>

<script>
import { mixinsModuleCss } from "@/components/DiyNew/diy/mixins/index.js";
import defaultImg from "@/assets/images/diy/default_img.png";
import memberCardTem from "../components/memberCard/index.vue";
import memberTabGroup from "../components/memberTabGroup/index.vue";

export default {
  name: "userMember",
  props: {
    propsData: {
      type: Object,
      default: {},
    },
  },
  mixins: [mixinsModuleCss],
  components: {
    memberCardTem,
    memberTabGroup,
  },
  data() {
    return {};
  },
  mounted() {},
  watch: {},
  computed: {
    fontColor() {
      return this.propsData.params.fontColor || "";
    },
  },
  methods: {
    handleItemToControl(e) {
      this.$emit("handleClassifyTabItem", e);
    },
  },
};
</script>

<style lang="scss" scoped>
.user-section {
  width: 100%;
  padding-top: 10px;
  position: relative;
  text-align: center;
  .user-avtor {
    width: 50px;
    height: 50px;
    background: #f7f2f4;
    border: 2px solid #ffffff;
    border-radius: 50%;
    overflow: hidden;
    margin: 0 auto 10px;
    img {
      width: 100%;
      height: 100%;
      display: block;
    }
  }
  .user-name {
    display: flex;
    justify-content: center;
    align-items: center;
    span {
      font-size: 17px;
      font-family: PingFang SC;
      font-weight: 600;
      color: rgba(255, 255, 255, 1);
    }
    img {
      width: 14px;
      height: 14px;
      border-radius: 4px;
      margin-left: 8px;
      display: block;
    }
  }
  .user-set {
    // width: 20px;
    // height: 20px;
    // position: absolute;
    // right: 18px;
    // top: 16px;
    // z-index: 11;
    // img {
    //   display: block;
    //   width: 100%;
    //   height: 100%;
    // }
    .iconfont {
      color: #ffffff;
      font-size: 26px;
      position: absolute;
      right: 18px;
      top: 16px;
      z-index: 11;
    }
  }
  .member-code {
    position: absolute;
    top: 16px;
    right: 59px;
    z-index: 11;
    display: flex;
    flex-direction: column;
    align-items: center;

    .iconfont {
      color: #ffffff;
      font-size: 26px;
    }
    .code-text {
      width: 38px;
      height: 15px;
      background: rgba(255, 255, 255, 0.1);
      border-radius: 60px;
      display: flex;
      justify-content: center;
      align-items: center;
      font-size: 9px;
      font-family: PingFang SC;
      font-weight: 400;
      color: rgba(255, 255, 255, 0.8);
      position: relative;
      top: -7px;
      span {
        transform: scale(0.75);
      }
    }
  }
  .menber-badges {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 8px;
    .menber-badges-item {
      height: 15px;
      background: rgba(0, 0, 0, 0.2);
      // opacity: 0.2;
      padding: 0 5px;
      display: flex;
      align-items: center;
      border-radius: 7.5px;
      padding-right: 12px;
      position: relative;
      div {
        font-size: 12px;
        font-family: PingFang SC;
        font-weight: 400;
        color: rgba(255, 255, 255, 1);
        line-height: 15px;
        transform: scale(0.8);
      }
      .iconfont {
        font-size: 12px;
        color: #ffffff;
        transform: scale(0.75);
        line-height: 16px;
        position: absolute;
        right: 4px;
        top: 0;
      }
    }
    .menber-badges-item:first-child {
      margin-right: 8px;
    }
  }
  .member-tabs {
    width: 94.67%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 13px auto;
    .tab-item {
      width: 25%;
      height: 44px;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: space-between;
      .tab-badge-num {
        font-size: 16px;
        font-family: PingFang SC;
        font-weight: 600;
        color: rgba(255, 255, 255, 1);
      }
      .tab-text {
        font-size: 12px;
        font-family: PingFang SC;
        font-weight: 400;
        color: rgba(255, 255, 255, 1);
      }
    }
  }
  .member-advance {
    width: 94.67%;
    height: 38px;
    background: linear-gradient(270deg, #303478 0%, #303b93 100%);
    border-radius: 10px 10px 0px 0px;
    margin: 0 auto;
    display: flex;
    // align-items: center;
    justify-content: space-between;
    padding: 7px 12px 0;
    position: relative;
    z-index: 10;
    .advance-left {
      display: flex;
      // align-items: center;
      .advance-img {
        width: 30px;
        height: 18px;
        position: relative;
        img {
          width: 100%;
          height: 100%;
          display: block;
        }
      }
      p {
        margin-bottom: 0;
        margin-left: 8px;
        font-size: 11px;
        font-family: PingFang SC;
        font-weight: 400;
        color: #f8d070;
      }
    }
    .advance-right {
      display: flex;
      // align-items: center;
      justify-content: flex-end;
      p {
        margin-bottom: 0;
        margin-right: 6px;
        font-size: 11px;
        font-family: PingFang SC;
        font-weight: 400;
        color: #f8d070;
      }
      .iconfont {
        transform: scale(0.95);
        font-size: 12px;
        color: #f8d070;
      }
    }
  }
  .member-group-tab {
    width: 94.67%;
    height: 47px;
    position: relative;
    margin: 0 auto;
    .group-tab-content {
      width: 100%;
      height: 55px;
      position: absolute;
      left: 0;
      bottom: 0;
      z-index: 11;
      border-radius: 10px;
      background: linear-gradient(270deg, #fdedcf 0%, #f2d6a6 100%);
      display: flex;
      align-items: center;
      .group-item {
        width: 33.3%;
        height: 100%;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: flex-start;
        padding-left: 12px;
        position: relative;
        .group-item-title {
          display: flex;
          align-items: center;
          img {
            width: 14px;
            height: 14px;
            background: #303685;
            border-radius: 50%;
            display: block;
            margin-right: 2px;
          }
          p {
            margin-bottom: 0;
            font-size: 13px;
            font-family: PingFang SC;
            font-weight: 600;
            color: #262626;
          }
        }
        .subtitle {
          font-size: 11px;
          font-family: PingFang SC;
          font-weight: 400;
          color: #b4853f;
          margin-bottom: 0;
          margin-top: 3px;
          display: flex;
          align-items: center;
          .iconfont {
            font-size: 12px;
            color: #b4853f;
            transform: scale(0.8);
            display: block;
          }
        }
      }
      .group-item::after {
        content: "";
        width: 1px;
        height: 20px;
        background: #efd5b1;
        position: absolute;
        right: 0;
        top: 17.5px;
      }
    }
  }
}
</style>
